30 PRINT: AP=CSRLIN: PRINT TAB(10);"What is the name of the DATAFILE you wish to analyze?": ON ERROR GOTO 430
40 PRINT TAB(3);"(Enter RETURN if you wish to evaluate significance of a known R value)"
50 LOCATE AP,65: INPUT "",FILE$
60 IF FILE$<>"" THEN 90 ELSE AF=1
70 PRINT: PRINT: PRINT TAB(10);: INPUT;"Enter R value: ",SR: SR2=SR*SR
75 IF SR>=1 THEN BEEP: PRINT " Your correlation coefficient should be a decimal fraction between 0 and 1.": GOTO 70
80 PRINT TAB(39);:INPUT "Number of data pairs: ",N: GOTO 240
90 AF=0: OPEN FILE$ FOR INPUT AS #1: INPUT #1,A,C
100 DIM D(A,C),CS(A,C),N$(A),X(A),X2(A),T(A),SD(A),MD(A)
110 FOR T=1 TO A: INPUT #1, T(T): NEXT
120 FOR T=1 TO A: FOR Z=1 TO C: INPUT #1, D(T,Z): NEXT: NEXT
130 FOR T=1 TO A: FOR Z=1 TO T(T): INPUT #1, CS(T,Z): NEXT: NEXT
140 FOR T=1 TO A: INPUT #1, N$(T),X(T),X2(T),MD(T),SD(T): NEXT: CLOSE #1
150 PRINT: PRINT: PRINT TAB(5);"What are the SAMPLE NUMBERS of the 2 groups you want to correlate?": PRINT
160 PRINT TAB(12);:INPUT;"Number: ",NS1: IF NS1<=A THEN PRINT " `";N$(NS1);"'"; ELSE BEEP: PRINT TAB(21);FILE$;" has only";A;"samples.": GOTO 160
165 PRINT TAB(45);:INPUT;"Number: ",NS2: IF NS2<=A THEN PRINT " `";N$(NS2);"'" ELSE BEEP: PRINT TAB(21);FILE$;" has only";A;"samples.": GOTO 165
170 IF T(NS1)<> T(NS2) THEN PRINT : PRINT "These 2 samples do not have the same number of elements----":PRINT TAB(32);"a correlation coefficient cannot be calculated.": GOTO 150
180 XC=0: N=T(NS1)
190 FOR Z=1 TO N: XC=XC+VAL(D(NS1,Z))*VAL(D(NS2,Z)): NEXT